﻿<%@ Page Title="test" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="IFD2.test" Culture="auto" UICulture="auto" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <!--仅Datepicker-->
    <%--<link href="jquery_ui/jquery-ui.min.css" rel="stylesheet" type="text/css" />
    <script src="jquery_ui/jquery-ui.min.js"></script>--%>
    <link href="Datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>

    <form id="form1" runat="server" role="form" class="form-inline">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><%: Title %></h5>
            <div class="form-group"><!--用于将提示和输入控件绑在一起，Bootstrap自动调整间距。此之前到col之间如无可显示字符，会导致右侧col文字无法顶对齐，偏下，不知为何？-->
                <asp:Label ID="Label4" CssClass="control-label" runat="server" Text="Flt. No.:" meta:resourcekey="FltNo"></asp:Label><!--sr-only会导致text无法100%宽度！-->
                <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control input-sm" Width="100%"></asp:TextBox>
            <!--/div>
            <div class="form-group"--><!--加上后TextBox不是100%宽度！WHY？-->
                <asp:Label ID="Label2" CssClass="control-label" runat="server" Text="Flt. Date:" meta:resourcekey="FltDate"></asp:Label> <!--此处资源名导致TextBox达不到100%宽度？-->
                <asp:TextBox ID="txtFltDate" runat="server" CssClass="form-control input-sm form_date" Width="100%" placeholder="" meta:resourcekey="FltDate2" MaxLength="10"></asp:TextBox>
            </div>

            <br class="hidden-xs"/><br class="hidden-xs"/>
            <!--button类不能嵌在form-group中，会导致button无法100%宽度！-->
            <!--div class="form-group"-->
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery">
                <span class="glyphicon glyphicon-search" style="font-size:large;"></span>
            </asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>

            <!--错误提示不能在侧边浮动，因为手机模式时无法浮动！-->
            <%--<div data-spy="affix" style="width:100%;">
                <div class="well well-sm ifdMessage" style="Margin:0px;word-wrap: break-word; word-break: normal; position:absolute;">
                    <asp:Label ID="Label5" runat="server" Text="sdfjklsjeljflseijfilsejfseilgsejflisejfilsejfilsejfseiljfs;" ></asp:Label>
                </div>
            </div>--%>

            <div class="hidden-xs">
                <div data-spy="affix"><!--data-offset-top="150" data-offset-bottom="100" --><!-- id="myScrollspy"-->
                    <ul class="nav nav-tabs nav-stacked"><!-- style="Margin:0px;word-wrap: break-word; word-break: normal;width:100%;" width:100%就不会自动换行了-->
                        <li class="active"><a href="#section-1"><asp:Literal ID="Literal2" meta:resourcekey="tipAffix" runat="server"></asp:Literal></a></li>
                        <li><a href="#section-2"><asp:Literal ID="Literal1" meta:resourcekey="tipAffix" runat="server"></asp:Literal></a></li>
                        <li><a href="#section-3"><asp:Literal ID="Literal4" meta:resourcekey="tipAffix" runat="server"></asp:Literal></a></li>
                        <li><a href="#section-4"><asp:Literal ID="Literal5" runat="server">sdlkfjs lhiegshl fjsifhse lfhsei llfh sefs efse</asp:Literal></a></listyle="Margin:0px;word-wrap:>
                    </ul>
                </div>
            </div>
            
        </div>

        <div class="col-sm-10 well well-sm">
            
            <div class="panel panel-default">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="secButton"><!--统一h6,有专用css-->
                        <a data-toggle="collapse"  href="#Button">
                            <asp:Literal ID="Literal3" runat="server" meta:resourcekey="Button"></asp:Literal>&nbsp;<b class="caret"></b>
                        </a>
                    </h6>
                </div>
                <div id="Button" class="panel-body panel-collapse collapse in">
                    <div class="table-responsive"> <!--用于手机环境限制表宽，出现水平滚动条-->
                    <asp:Panel ID="Panel1" runat="server"><!--用于限制表高，出现垂直滚动条-->
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" DataKeyNames="bk_id,pax_sn" 
                        style="min-width:1200px;width:auto;" class="table-hover" OnDataBound="GridView1_DataBound">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="bk_id" HeaderText="bk_id" SortExpression="bk_id" ReadOnly="True" />
                            <asp:BoundField DataField="pax_sn" HeaderText="pax_sn" SortExpression="pax_sn" ReadOnly="True"/>
                            <asp:BoundField DataField="ffp_id" HeaderText="ffp_id" SortExpression="ffp_id" />
                            <asp:BoundField DataField="ffp_airline" HeaderText="ffp_airline" SortExpression="ffp_airline" />
                            <%--<asp:BoundField DataField="pax_value" HeaderText="pax_value" SortExpression="pax_value" />
                            <asp:BoundField DataField="family_name_en" HeaderText="family_name_en" SortExpression="family_name_en" />
                            <asp:BoundField DataField="name_en" HeaderText="name_en" SortExpression="name_en" />
                            <asp:BoundField DataField="family_name" HeaderText="family_name" SortExpression="family_name" />
                        
                            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
                            <asp:CheckBoxField DataField="hold_inf" HeaderText="hold_inf" SortExpression="hold_inf" />
                            <asp:CheckBoxField DataField="male" HeaderText="male" SortExpression="male" />
                            <asp:BoundField DataField="age_type" HeaderText="age_type" SortExpression="age_type" />
                            <asp:BoundField DataField="inf_dob" HeaderText="inf_dob" SortExpression="inf_dob" />
                            <asp:BoundField DataField="nationality" HeaderText="nationality" SortExpression="nationality" />
                            <asp:BoundField DataField="id_type" HeaderText="id_type" SortExpression="id_type" />
                            <asp:BoundField DataField="id_no" HeaderText="id_no" SortExpression="id_no" />
                            <asp:BoundField DataField="id_no_chksum_X" HeaderText="id_no_chksum_X" SortExpression="id_no_chksum_X" />
                            <asp:BoundField DataField="id_expired_date" HeaderText="id_expired_date" SortExpression="id_expired_date" />
                            <asp:BoundField DataField="mobile_phone" HeaderText="mobile_phone" SortExpression="mobile_phone" />
                            <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
                            <asp:CheckBoxField DataField="vip" HeaderText="vip" SortExpression="vip" />
                            <asp:CheckBoxField DataField="alone_chd" HeaderText="alone_chd" SortExpression="alone_chd" />
                            <asp:BoundField DataField="move_assistant" HeaderText="move_assistant" SortExpression="move_assistant" />
                            <asp:BoundField DataField="meal" HeaderText="meal" SortExpression="meal" />
                            <asp:BoundField DataField="remark" HeaderText="remark" SortExpression="remark" />
                            <asp:CheckBoxField DataField="need_invoice" HeaderText="need_invoice" SortExpression="need_invoice" />
                            <asp:BoundField DataField="mail_address" HeaderText="mail_address" SortExpression="mail_address" />
                            <asp:BoundField DataField="post_code" HeaderText="post_code" SortExpression="post_code" />
                            <asp:CheckBoxField DataField="cancelled" HeaderText="cancelled" SortExpression="cancelled" />
                            <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user" />
                            <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time" />--%>
                        
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="False" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                    </asp:Panel>
                    </div>
                    <div class="table-responsive">
                        <table style="table-layout:fixed;white-space:nowrap;">
                        <tr><td>sdkjf sdfkjsd dslkfjs dlksfj slejfl dsljf sdlf sdflk jdsflsiejfes sdlf jsef sadadsas&nbsp;</td><td>slkf djlks jefdgfd fdgddfgd</td></tr>
                        <tr><td>sdkjf</td><td>slkfdsdf</td></tr>
                        </table>
                    </div>
                    <div class="btn-group"><!-- btn-group-justified-->
                        <asp:Button ID="Button1" CssClass="btn btn-sm btn-default" runat="server" Text="Route" />
                        <asp:Button ID="Button7" CssClass="btn btn-sm btn-default" runat="server" Text="Route..." Enabled="false" />
                        <asp:Button ID="Button9" CssClass="btn btn-sm" runat="server" Text="太沉，不用" />
                        <asp:Button ID="Button13" CssClass="btn btn-sm btn-default btn-alert" runat="server" Text="Route!" />
                    </div>
                    <asp:Button ID="Button8" CssClass="btn btn-sm btn-default" runat="server" Text="Route..." />
                    <asp:Button ID="Button12" CssClass="btn btn-sm btn-default" runat="server" Text="Route" Enabled="false" />
                    <asp:Button ID="Button14" CssClass="btn btn-sm btn-default btn-alert" runat="server" Text="Route !" Enabled="false" />
                     
                    <div class="well well-sm">
                        <h6>sub title</h6>
                        <div class="form-group">
                            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                            <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control input-sm form_datetime" MaxLength="6"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <asp:CheckBox ID="CheckBox3" runat="server"/>
                        </div>
                        <div class="form-group">
                            <asp:RadioButton ID="RadioButton1" runat="server"  Text="male" GroupName="sex" />
                            <asp:RadioButton ID="RadioButton2" runat="server"  Text="female" GroupName="sex" />
                        </div>
                        <div class="form-group">
                            <asp:DropDownList ID="DropDownList1" runat="server">
                                <asp:ListItem Value="3e">segsejkliu</asp:ListItem>
                                <asp:ListItem Value="sge">segsef</asp:ListItem>
                                <asp:ListItem Enabled="False" Value="sd">sdfsd</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="form-group">
                            <asp:ListBox ID="ListBox1" runat="server">
                                <asp:ListItem Value="fe">awdawf</asp:ListItem>
                                <asp:ListItem Value="awd">agweawed</asp:ListItem>
                                <asp:ListItem Enabled="False" Value="ad">sdfse</asp:ListItem>
                            </asp:ListBox>
                        </div>
                        

                        <div class="btn-group">
                            <asp:Button ID="Button5" runat="server" Text="  Set  " CssClass="input-sm btn"/>
                            <asp:Button ID="Button10" runat="server" Text="  Set  " CssClass="input-sm btn-default"/>
                            <asp:Button ID="Button4" runat="server" Text="set" CssClass="form-control input-sm btn-warning" Enabled="False" />
                        </div>
                        
                        <asp:Button ID="Button2" runat="server" Text="  alert  " CssClass="form-control input-sm btn-alert"/>
                        <asp:Button ID="Button3" runat="server" Text="  Warning  " CssClass="form-control input-sm btn-warning" Enabled="false"/>
                        <asp:Button ID="Button6" runat="server" Text="  Set  " CssClass="form-control input-sm btn-primary"/>
                        <br />
                        <asp:Label ID="lblError" runat="server" Text="Label" CssClass="ifdMessage"></asp:Label>
                    </div>
                    
                </div>
            </div>
            
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal6" runat="server" meta:resourcekey="tipAffix"></asp:Literal></h6>
                </div>
                <div class="panel-body" style="width:auto;">
                    
                    <button type="button" id="button11" onclick="$('#ajax1').load('/test_ajax.txt?ver=19');$('#modXXX').modal('show');">ajax test</button>
                </div>
            </div>

            
            <div class="well well-sm">
                <h6 id="section-3">Well</h6>
                <div class="table-responsive">
                    <asp:GridView ID="grdEmd" runat="server" AutoGenerateColumns="False"  style="min-width:800px;width:100%;"
                            CellPadding="4" DataKeyNames="bk_id,pax_sn,cart_time" DataSourceID="sqlEmdCart" ForeColor="#333333" GridLines="None" OnDataBound="grdEmd_DataBound">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <input name="emdKEY" type="radio" value='<%#Eval("bk_id")+"|"+Eval("pax_sn")+"|"+Eval("cart_time") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="pax_sn" HeaderText="pax_sn" meta:resourcekey="pax_sn" SortExpression="pax_sn" />
                                <asp:BoundField DataField="trip_sn" HeaderText="trip_sn" meta:resourcekey="trip_sn" SortExpression="trip_sn" />
                                <asp:TemplateField HeaderText="EMD ID" meta:resourcekey="EMD_ID">
                                    <ItemTemplate>
                                        <%# Eval("emd_airline") + "" + Eval("emd_id")%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="emd_name" HeaderText="emd_name" meta:resourcekey="emd_name" SortExpression="emd_name" />
                                <asp:BoundField DataField="emd_note" HeaderText="emd_note" meta:resourcekey="emd_note" SortExpression="emd_note" HtmlEncode="false" />
                                <asp:BoundField DataField="currency" HeaderText="currency" meta:resourcekey="currency1" SortExpression="currency" />
                                <asp:BoundField DataField="price" HeaderText="price" meta:resourcekey="price1" SortExpression="price" />
                                <asp:BoundField DataField="quantity" HeaderText="quantity" meta:resourcekey="quantity1" SortExpression="quantity" />
                                <asp:BoundField DataField="remark" HeaderText="remark" meta:resourcekey="remark1" SortExpression="remark" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user" meta:resourcekey="done_user" SortExpression="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" meta:resourcekey="done_time" SortExpression="done_time" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                        <asp:HiddenField ID="hidOrderNoEmd" runat="server" Value="90000905654" />
                        <asp:SqlDataSource ID="sqlEmdCart" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                            SelectCommand="bll_bk_get_emd_info" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="hidOrderNoEmd" Name="bk_id" PropertyName="Value" Type="Int64" />
                                <asp:SessionParameter Name="lang" SessionField="LANG" Type="Int16" />
                                <asp:SessionParameter Name="user" SessionField="USER" Type="String" />
                                <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter Name="office_type" SessionField="OFFICE_TYPE" Type="String" />
                                <asp:SessionParameter Name="user_airline" SessionField="AIRLINE" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                </div>
                <span class="visible-lg"> large device </span>
                <span class="visible-md"> medium device </span>
                <span class="visible-sm"> small device </span>
                <span class="visible-xs"> xs device </span>
                <h1>h1</h1>
                <h2>h2</h2>
                <h3>h3</h3>
                <h4>h4</h4>
                <h5>h5</h5>
                <h6>h6</h6>
                <p>pppp中文</p>
                <asp:Button ID="Button15" CssClass="btn btn-sm btn-default" runat="server" Text="Route" OnClick="Button15_Click" /><br />
                <asp:Label ID="Label3" runat="server" Text="Label" CssClass="ifdMessage"></asp:Label>
            </div>
        </div>

        
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" SelectCommand="SELECT top 10 * FROM [bk_names]"></asp:SqlDataSource>
    
    </div></form>

    <!--不能放在UpdatePanel中！也不能放在container中，否则Popup总的table-responsive表格无法滚动！-->
    <div class="modal fade bs-example-modal-lg" id="modXXX" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > <!--style="text-align:center;"-->
        <div class="modal-dialog modal-lg" style="width: 100%;"><!-- style="width: 100%;"-->
            <div class="modal-content">
                <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h6></h6>
                </div>
                <div class="modal-body">
                <p id="ajax1" class="ifdModal">Retrieving...</p>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

    <script src="Datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script>
        $(document).ready(function () {
            //绑定Datepicker
  	        //$("#MainContent_txtFltDate").datepicker({
  	        //    dateFormat: "yy-mm-dd", numberOfMonths: 2, showButtonPanel: true
            //});
            var win_height = parseInt($(window).height());
            var tab_new_height = win_height - 50 - 100;
            if ($('#<%=Panel1.ClientID %>').height() > tab_new_height)
                $('#<%=Panel1.ClientID %>').height = tab_new_height;

            $('.form_datetime').datetimepicker({
                format: 'yyyy-m-d hh:ii',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'month',
                forceParse: 0,
                showMeridian: 0
            });
  	        $('.form_date').datetimepicker({
  	            format: 'yyyy-m-d',
  	            weekStart: 1,
  	            todayBtn: 1,
  	            autoclose: 1,
  	            todayHighlight: 1,
  	            startView: 'month',
  	            minView: 'month',
  	            forceParse: 0
  	        });
            $('.form_time').datetimepicker({
                format: 'hh:ii' ,
                weekStart: 1,
                todayBtn:  1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'day',
                minView: 'hour',
                maxView: 'day',
                forceParse: 0
            });

            ////调整表格区域（table-responsive）宽度
  	        //var win_width = parseInt($(window).width());//浏览器窗口可视区域宽度
  	        //if (win_width >= 768) {
  	        //    $(".table-responsive").width(parseInt(win_width * 10 / 12-40) +"px");
  	        //    //alert("a:" + win_width);
  	        //    //alert($(".table-responsive").width());

            //    //调整浮动错误消息宽度
  	        //    var col_width = $(".col-sm-2").width();
  	        //    $(".ifdMessage").width(parseInt(col_width-20)+"px");
  	        //    //alert("b:"+col_width);
  	        //    //alert($(".ifdMessage").width());
  	        //}
  	    });
  	</script>

</asp:Content>
